package org.cytoscape.myapp.cytoscape_app_v1.internal.visual;

import org.cytoscape.view.model.VisualProperty;
import org.cytoscape.view.vizmap.VisualMappingFunction;
import org.cytoscape.view.vizmap.mappings.ContinuousMapping;

public class MappingFunctionContinuousSimple implements MappingFunction {

	private String nameAttribute;
	private VisualInstanceDependecies dependecies;
	private VisualProperty<?> property;
	private Class<?> type;
	
	
	public String getNameAttribute() {
		return nameAttribute;
	}

	public void setNameAttribute(String nameAttribute) {
		this.nameAttribute = nameAttribute;
	}
	
	
	public MappingFunctionContinuousSimple(String nameAttribute,
			VisualInstanceDependecies dependecies, VisualProperty property,
			Class<?> type) {
		super();
		this.nameAttribute = nameAttribute;
		this.dependecies = dependecies;
		this.property = property;
		this.type = type;
	}


	@Override
	public <T> VisualMappingFunction<?, ?> createVisualMappingFunction() {
		
		ContinuousMapping<?, ?> mapping = (ContinuousMapping<?, ?>)
					dependecies.getVmfFactoryC().createVisualMappingFunction(this.nameAttribute, type, property);
		
		return mapping;
	}

}
